-- skynet = require "skynet"
-- require "skynet.manager"

-- local function dosomething(session, address, ...)
--     skynet.error("session", session)
--     skynet.error("address", skynet.address(address))
--     local args = {...}
--     for i,v in pairs(args) do
--          skynet.error("arg"..i..":", v)
--     end
-- end
-- skynet.start(function()
--     --注册"lua"类型消息的回调函数
--     skynet.dispatch("lua", function(session, address, ...)
--           dosomething(session, address, ...)
--     end)
--     skynet.register(".testluamsg")
-- end)


skynet = require "skynet"
require "skynet.manager"

local function dosomething(session, address, ...)
    skynet.error("session", session)
    skynet.error("address", skynet.address(address))
    local args = {...}
    for i,v in pairs(args) do
         skynet.error("arg"..i..":", v)
    end
    return 100, false
end
skynet.start(function()
    --注册"lua"类型消息的回调函数
    skynet.dispatch("lua", function(session, address, ...)
          --skynet.sleep(500)
          skynet.retpack(dosomething(session, address, ...)) --申请响应消息C内存
           --或者skynet.ret(skynet.pack(dosomething(session, address, ...)))
    end)--skynet.dispatch完成后,释放调用接收消息C内存
    skynet.register(".testluamsg")
end)